/*
 * @(#)MultiboxTag.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.framework.taglib.html;

import javax.servlet.jsp.JspException;

/**
  MultiboxTag.java

  <p>This class is to to addin javascript checing during input multibox onchange. </p>
  <p>Purpose to Override struts taglib for tracing form modification.<p>
  <p>Modification in "struts-html.tld"<br>
  <pre>
     [FROM]
     &lt;tagclass&gt;org.apache.struts.taglib.html.MultiboxTag&lt;/tagclass&gt;
     [TO]
     &lt;tagclass&gt;com.dcivision.framework.taglib.html.MultiboxTag&lt;/tagclass&gt;

     [ADDED]
     &lt;attribute&gt;
     &lt;name&gt;textOnly&lt;/name&gt;
     &lt;required&gt;false&lt;/required&gt;
     &lt;rtexprvalue&gt;true&lt;/rtexprvalue&gt;
     &lt;/attribute&gt;
  </pre>
  </p>

    @author          Rollo Chan
    @company         DCIVision Limited
    @creation date   09/07/2003
    @version         $Revision: 1.8 $
*/

public class MultiboxTag extends org.apache.struts.taglib.html.MultiboxTag {

  public static final String REVISION = "$Revision: 1.8 $";

  protected boolean textOnly = false;

  public int doStartTag() throws JspException {
    switch (BaseHandler.commonRoutine(this, pageContext, this.getTextOnly())) {
      case BaseHandler.DIRECT_SKIP_BODY:
        return SKIP_BODY;
      case BaseHandler.DIRECT_EVAL_BODY_BUFFERED:
        return EVAL_BODY_BUFFERED;
      case BaseHandler.RETURN_SUPER_DOSTART:
        return super.doStartTag();
      default:
        return super.doStartTag();
    }
  }

  public void setTextOnly(boolean val){
    textOnly = val;
  }

  public boolean getTextOnly(){
    return textOnly;
  }
  
  public void release() {
    super.release();
    textOnly = false;
  }

}
